<?php


namespace app\model;


use think\facade\Db;
use think\Model;

class Article extends Model
{

    public function hot(){
        $result = Db::name('hot_keywords')->field('id,name')->order('sort desc')->select()->toArray();
        return app('json')->json_success('成功', $result);
    }

    public function suggest($data){
        Db::name('suggest')->insert(['user_id'=>$data['user_id'],'content'=>$data['content']]);
        return app('json')->json_success('成功');
    }
}